@(questions: List[models.domain.Question],courses: List[models.general.vKennariHoparOnn], annir: List[models.data.Annir])
@teacherMain(title = "Spurningabanki") {

    <link rel="stylesheet" href="/public/stylesheets/AssignmentQuestions.css">
    <script src="/public/javascripts/DataTables/datatables.js"></script>
    <script src="/public/javascripts/DataTables/datatables-bootstrap.js"></script>
    <script src="/public/javascripts/questionBank.js"></script>

    <div class="container conLower">
        <div class="row">
            <div class="span12">


                <div>
                    <h2 class="span5" style="margin:0">Allar spurningar </h2>

                    <script>
                            function showshow (val)
                            { $("#"+val).popover({html:true});
                            }
                    </script>

                    <p id="createNewQuestion"  class="float-left"><a href="@routes.TeacherController.createQuestion(0)" style="margin-top:10px;" role="button" class="btn btn-primary" data-toggle="modal"> <i class="icon-white icon-edit"></i> Búa til nýja spurningu</a> </p>


                    <table class="table table-hover" id="tbl2">
                        <thead>
                            <tr>
                                <th></th>
                                <th><strong>Spurning</strong></th>
                                <th>Tegund</th>
                                <th class="span2">Bók</th>
                                <th>Áfangi</th>
                                <th style="width:100px">Leitarskilyrði</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody id="tbl2body">
                            @for(question <- questions){
                                <tr id="row@question.spurningar_id">

                                <td><a href="javascript:showshow('@question.spurningar_id');" id='@question.spurningar_id' data-placement="right" class="btn btn-mini" rel="popover" data-content="<strong>Texti spurningar:</strong> @question.texti<br/><strong>Tegund spurningar:</strong> @question.tegund<br/><strong>Áfangi:</strong> @question.namsgrein_afanganr<br/><strong>Heiti bókar:</strong> @question.bok_heiti<br/><strong>Þyngdarstig spurningar:</strong> @question.tyngdarstig_heiti<br/><strong>Búin til:</strong> @question.dagurbuidtil" data-original-title="<strong>Frekari upplýsingar</strong>"><i class="icon-search"></i></a></td>
                                <td>@{question.texti}</td>

                                    @if(question.tegund=="texti"){
                                        <td>Textaspurning</td>
                                    }
                                    @if(question.tegund=="krossar"){
                                        <td>Krossaspurning</td>
                                    }
                                    @if(question.tegund=="eydufylling"){
                                        <td>Eyðufylling</td>
                                    }
                                    @if(question.tegund=="fjolval"){
                                        <td>Fjölvalsspurning</td>
                                    }
                                    @if(question.tegund=="mynd"){
                                        <td>Myndaspurning</td>
                                    }
                                    @if(question.tegund=="vidhengi"){
                                        <td>Viðhengi</td>
                                    }
                                <td class="span2"><strong>@{question.bok_heiti}</strong></td>
                                <td><strong>@{question.namsgrein_afanganr}</strong></td>
                                <td><ul style="margin-left:0px" class="tags">
                                    @for(tag <- question.tags){
                                        <li>
                                            @tag.leitarskilyrdi
                                        </li>
                                    }

                                </ul></td>

                                    @if(question.tegund=="krossar"){
                                        <td><a href="@routes.TeacherController.changeSingleChoiceQuestion(question.spurningar_id)" title="Breyta spurningu"><i class="icon-edit"></i></a></td>
                                    }
                                    @if(question.tegund=="fjolval"){
                                        <td><a href="@routes.TeacherController.changeMultiChoiceQuestion(question.spurningar_id)" title="Breyta spurningu"><i class="icon-edit"></i></a></td>
                                    }
                                    @if(question.tegund=="texti"){
                                        <td><a href="@routes.TeacherController.changeTextQuestion(question.spurningar_id)" title="Breyta spurningu"><i class="icon-edit"></i></a></td>
                                    }
                                    @if(question.tegund=="eydufylling"){
                                        <td><a href="@routes.TeacherController.changeEydufyllingQuestion(question.spurningar_id)" title="Breyta spurningu"><i class="icon-edit"></i></a></td>
                                    }
                                    @if(question.tegund=="mynd"){
                                        <td><a href="" ></a></td>
                                    }
                                    @if(question.tegund=="vidhengi"){
                                        <td><a href="" ></a></td>
                                    }

                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div> <!--end of container-->
}
